home *** CD-ROM | disk | FTP | other *** search
-
- //-------------------------------------------------------------------------------
-
- // global variable.
- var gNodeList = new Array;
- var gCurrImageObj = null;
- var gnTOP_POS = 16;
- var gnTop = gnTOP_POS;
- var gnHiddenTop = gnTOP_POS;
- var gBrowser = 0;
- var IE = 1;
- var NN = 2;
- var gsName = "bookmark";
-
- var gsTarget = "_blank";
-
- var gBlankImg = new Image;
- var gVertLineImg = new Image;
- var gNodeImg = new Image;
- var gLastNodeImg = new Image;
-
- var gCloseFileImg = new Array;
- var gOpenFileImg = new Array;
- var gFileImg = new Array;
-
- gCloseFileImg[0] = new Image;
- gCloseFileImg[1] = new Image;
- gOpenFileImg[0] = new Image;
- gOpenFileImg[1] = new Image;
- gFileImg[0] = new Image;
- gFileImg[1] = new Image;
-
-
- //-------------------------------------------------------------------------------
-
- function list(sTitle, nDstPage, nEndPage, sURL, nID)
- {
- this.sTitle = sTitle;
- this.nDstPage = nDstPage;
- this.nEndPage = nEndPage;
- this.bExpanded = false;
- this.bShow = false;
- this.parent = null;
- this.children = new Array;
- this.objectID = null;
- this.imageID = null;
-
- this.sURL = sURL;
- this.nID = nID;
- }
-
- //-------------------------------------------------------------------------------
-
- function appendList(parentNode, childNode)
- {
- childNode.parent = parentNode;
- parentNode.children[parentNode.children.length] = childNode;
-
- return childNode;
- }
-
- function displayListx(nodeList, nDepth)
- {
- var i, j, k;
- var parentNode, grandParentNode;
-
- for(i=0; i<nodeList.length; i++)
- {
- if(nodeList[i].nDstPage > -2)
- document.write('<a href="#" onClick="JavaScript:openPageAbs(' + nodeList[i].nDstPage + ', image' + nodeList[i].nID + '); return false">');
- else
- document.write('<a href="' + nodeList[i].sURL + '" target=' + gsTarget + '>');
- document.write('<font size=2 color="blue" face="Helvetica">' + nodeList[i].sTitle + '</font>');
- document.write('</a>');
-
- for (j=0; j<nodeList[i].children.length;j++)
- {
- document.writeln(nodeList[i].children[j].sTitle + "<BR>");
- }
- }
-
- }
-
- //-------------------------------------------------------------------------------
- // this is a recursive function.
-
- function displayList(nodeList, nDepth)
- {
- var i, j, k;
- var parentNode, grandParentNode;
- var statusCnt=0;
- var statusStr="Working";
-
- for(i = 0; i < nodeList.length; i++)
- {
- // DISPLAY STATUS...
- if(!statusCnt)
- {
- statusStr+=".";
- window.status=statusStr;
- }
- statusCnt=(statusCnt+1)%5;
-
-
- if (nodeList[i].sTitle.substr(0,1) == '<')
- {
- document.write(nodeList[i].sTitle);
- continue;
- }
-
- if(gBrowser == IE)
- {
- if(nodeList[i].children.length > 0)
- document.write('<span id="node' + nodeList[i].nID + '" style="display:');
- else
- document.write('<span id="child' + nodeList[i].nID + '" style="display:');
-
- if(nodeList[i].parent != null)
- document.write('none">\n');
- else
- document.write('block">\n');
- }
- else if(gBrowser == NN)
- {
- if(nodeList[i].parent == null)
- {
- nodeList[i].bShow = true;
-
- if(i == 0 && nodeList[i].parent != null)
- gnTop = gnTop + nodeList[i].parent.objectID.clip.height;
- else if(i > 0)
- gnTop = gnTop + nodeList[i - 1].objectID.clip.height;
- }
- else
- nodeList[i].bShow = false;
-
- if(i == 0 && nodeList[i].parent != null)
- gnHiddenTop = gnHiddenTop + nodeList[i].parent.objectID.clip.height;
- else if(i > 0)
- gnHiddenTop = gnHiddenTop + nodeList[i - 1].objectID.clip.height;
-
- if(nodeList[i].children.length > 0)
- document.write('<layer id="node');
- else
- document.write('<layer id="child');
-
- if(nodeList[i].parent != null)
- document.write(nodeList[i].nID + '" top=' + gnHiddenTop + ' visibility="hide">\n');
- else
- document.write(nodeList[i].nID + '" top=' + gnTop + ' visibility="show">\n');
- }
-
-
- document.write('<table border=0 cellspacing=0 cellpadding=0>\n<tr>\n');
- document.write('<td valign="left" nowrap>');
-
- for(j = nDepth - 1; j > 0; j--)
- {
- parentNode = nodeList[i];
- for(k = j; k > 0; k--)
- parentNode = parentNode.parent;
-
- grandParentNode = parentNode.parent;
-
- if(grandParentNode.children[grandParentNode.children.length - 1] == parentNode)
- document.write('<img src="' + gBlankImg.src + '" border=0>');
- else
- document.write('<img src="' + gVertLineImg.src + '" border=0>');
- }
-
- if(nDepth > 0)
- {
- if((i + 1) == nodeList.length)
- document.write('<img src="' + gLastNodeImg.src + '" border=0>');
- else
- document.write('<img src="' + gNodeImg.src + '" border=0>');
- }
-
- if(nodeList[i].children.length > 0 && gBrowser)
- {
- document.write('<a href="#" onClick="JavaScript:openNode(' + nodeList[i].nID + '); return false">');
- document.write('<img src="' + gCloseFileImg[0].src + '" border=0 name="image' + nodeList[i].nID + '">');
- document.write('</a>');
- }
- else
- document.write('<img src="' + gFileImg[0].src + '" border=0 name="image' + nodeList[i].nID + '">');
-
- document.write('</td><td valign="middle" nowrap>');
-
- if(nodeList[i].nDstPage > -2)
- document.write('<a href="#" onClick="JavaScript:openPageAbs(' + nodeList[i].nDstPage + ', image' + nodeList[i].nID + '); return false">');
- else
- document.write('<a href="' + nodeList[i].sURL + '" target=' + gsTarget + '>');
-
- document.write('<font size=2 color="blue" face="Helvetica">' + nodeList[i].sTitle + '</font>');
- document.write('</a>');
- document.write('</td>');
- document.write('</tr>\n</table>\n');
-
- if(gBrowser == IE)
- {
- document.write('</span>\n');
-
- if(nodeList[i].children.length > 0)
- nodeList[i].objectID = document.all["node" + nodeList[i].nID];
- else
- nodeList[i].objectID = document.all["child" + nodeList[i].nID];
-
- nodeList[i].imageID = document.all["image" + nodeList[i].nID];
- }
- else if(gBrowser == NN)
- {
- document.write('</layer>\n');
-
- if(nodeList[i].children.length > 0)
- nodeList[i].objectID = document.layers["node" + nodeList[i].nID];
- else
- nodeList[i].objectID = document.layers["child" + nodeList[i].nID];
-
- nodeList[i].imageID = nodeList[i].objectID.document.images[nodeList[i].objectID.document.images.length-1];
- }
-
- if(nodeList[i].children.length > 0)
- displayList(nodeList[i].children, nDepth + 1);
- }
-
- window.status="";
- }
-
- //-------------------------------------------------------------------------------
-
- function openPageAbs(nPageNum, imageObj)
- {
- if(nPageNum > 0)
- {
- changeSelectedIcon(imageObj);
- parent.nav.openPageAbsNoUpdateContents(nPageNum);
- }
- else
- alert("This link has no destination.");
- }
-
- //-------------------------------------------------------------------------------
-
- function openNode(nID)
- {
- var node = searchNode(gNodeList, nID);
- if(node == null)
- return;
-
- if(node.bExpanded == false)
- {
- node.bExpanded = true;
- expandNode(node.children)
- }
- else
- {
- node.bExpanded = false;
- shrinkNode(node.children)
- }
-
- changeExpandIcon(node.imageID, node.bExpanded);
-
- if(gBrowser == NN)
- {
- gnTop = gnTOP_POS;
- adjustListPos(gNodeList);
- }
- }
-
- //-------------------------------------------------------------------------------
-
- function expandNode(node)
- {
- var i;
-
- for(i = 0; i < node.length; i++)
- {
- if(gBrowser == IE)
- {
- if(node[i].objectID.style.display == "none")
- if(node[i].parent == null || node[i].parent.bExpanded == true)
- node[i].objectID.style.display = "block";
- }
- else if(gBrowser == NN)
- {
- if(node[i].bShow == false)
- if(node[i].parent != null && node[i].parent.bExpanded == true)
- node[i].bShow = true;
- }
-
- if(node[i].children.length > 0 && node[i].bExpanded == true)
- expandNode(node[i].children);
- }
- }
-
- //-------------------------------------------------------------------------------
-
- function shrinkNode(node)
- {
- var i;
-
- for(i = 0; i < node.length; i++)
- {
- if(gBrowser == IE)
- {
- if(node[i].objectID.style.display == "block")
- node[i].objectID.style.display = "none";
- }
- else if(gBrowser == NN)
- {
- if(node[i].bShow == true)
- node[i].bShow = false;
- }
-
- if(node[i].children.length > 0)
- shrinkNode(node[i].children);
- }
- }
-
- //-------------------------------------------------------------------------------
-
- function updateTree(nPageNum)
- {
- var node = ProcessOpenedNode(gNodeList, nPageNum);
-
- if(gBrowser == NN)
- {
- gnTop = gnTOP_POS;
- adjustListPos(gNodeList);
- }
- }
-
- //-------------------------------------------------------------------------------
- // this is a recursive function.
-
- function ProcessOpenedNode(nodeList, nPageNum)
- {
- var i, k;
- var node;
-
- for(i = 0; i < nodeList.length; i++)
- {
- //if(nodeList[i].nDstPage == nPageNum)
- if(nPageNum >= nodeList[i].nDstPage && nPageNum <= nodeList[i].nEndPage)
- {
- if(nodeList[i].children.length > 0)
- {
- node = ProcessOpenedNode(nodeList[i].children, nPageNum);
-
- if(node != null)
- {
- nodeList[i].bExpanded = true; // expand parent.
- changeExpandIcon(nodeList[i].imageID, nodeList[i].bExpanded);
-
- for(k = 0; k < nodeList.length; k++)
- {
- if(gBrowser == IE)
- {
- if(nodeList[k].objectID.style.display == "none")
- nodeList[k].objectID.style.display = "block";
- }
- else if(gBrowser == NN)
- {
- if(nodeList[k].bShow == false)
- nodeList[k].bShow = true;
- }
- }
- changeSelectedIcon(node.imageID);
-
- return node;
- }
- }
-
- for(k = 0; k < nodeList.length; k++)
- {
- if (nodeList[k].sTitle.substr(0,1) == '<')
- continue;
-
- if(gBrowser == IE)
- {
- if(nodeList[k].objectID.style.display == "none")
- nodeList[k].objectID.style.display = "block";
- }
- else if(gBrowser == NN)
- {
- if(nodeList[k].bShow == false)
- nodeList[k].bShow = true;
- }
- }
- changeSelectedIcon(nodeList[i].imageID);
-
- return nodeList[i];
- }
- else if(nodeList[i].children.length > 0)
- {
- node = ProcessOpenedNode(nodeList[i].children, nPageNum);
-
- if(node != null)
- {
- nodeList[i].bExpanded = true; // expand parent.
- changeExpandIcon(nodeList[i].imageID, nodeList[i].bExpanded);
-
- for(k = 0; k < nodeList.length; k++)
- {
- if (nodeList[k].sTitle.substr(0,1) == '<')
- continue;
-
- if(gBrowser == IE)
- {
- if(nodeList[k].objectID.style.display == "none")
- nodeList[k].objectID.style.display = "block";
- }
- else if(gBrowser == NN)
- {
- if(nodeList[k].bShow == false)
- nodeList[k].bShow = true;
- }
- }
- changeSelectedIcon(node.imageID);
-
- return node;
- }
- }
- }
-
- return null;
- }
-
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
-
- function adjustListPos(nodeList)
- {
- var i;
-
- for(i = 0; i < nodeList.length; i++)
- {
- if(nodeList[i].bShow == true)
- {
- if(i == 0 && nodeList[i].parent != null)
- gnTop = gnTop + nodeList[i].parent.objectID.clip.height;
- else if(i > 0)
- gnTop = gnTop + nodeList[i - 1].objectID.clip.height;
-
- nodeList[i].objectID.moveTo(nodeList[i].objectID.left, gnTop)
- nodeList[i].objectID.visibility = "show";
- }
- else
- nodeList[i].objectID.visibility = "hide";
-
- if(nodeList[i].children.length > 0)
- adjustListPos(nodeList[i].children);
- }
- }
-
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
-
- function changeExpandIcon(imageObj, bExpand)
- {
- if(imageObj == null)
- return;
-
- if(bExpand == true)
- {
- if(imageObj.src == gCloseFileImg[1].src)
- imageObj.src = gOpenFileImg[1].src;
- else
- imageObj.src = gOpenFileImg[0].src;
- }
- else
- {
- if(imageObj.src == gOpenFileImg[1].src)
- imageObj.src = gCloseFileImg[1].src;
- else
- imageObj.src = gCloseFileImg[0].src;
- }
- }
-
- //-------------------------------------------------------------------------------
-
- function changeSelectedIcon(imageObj)
- {
- if(imageObj != null)
- {
- if(imageObj.src == gCloseFileImg[0].src)
- imageObj.src = gCloseFileImg[1].src;
- else if(imageObj.src == gOpenFileImg[0].src)
- imageObj.src = gOpenFileImg[1].src;
- else if(imageObj.src == gFileImg[0].src)
- imageObj.src = gFileImg[1].src;
- }
-
- if(gCurrImageObj != null && gCurrImageObj != imageObj)
- {
- if(gCurrImageObj.src == gCloseFileImg[1].src)
- gCurrImageObj.src = gCloseFileImg[0].src;
- else if(gCurrImageObj.src == gOpenFileImg[1].src)
- gCurrImageObj.src = gOpenFileImg[0].src;
- else if(gCurrImageObj.src == gFileImg[1].src)
- gCurrImageObj.src = gFileImg[0].src;
- }
-
- gCurrImageObj = imageObj;
- }
-
- //-------------------------------------------------------------------------------
- // this is a recursive function.
-
- function searchNode(nodeList, nID)
- {
- var node;
- var i;
-
- for(i = 0; i < nodeList.length; i++)
- {
- if(nodeList[i].nID == nID)
- return nodeList[i];
- else if(nodeList[i].children.length > 0)
- {
- node = searchNode(nodeList[i].children, nID);
- if(node != null)
- return node;
- }
- }
-
- return null;
- }
-
- //-------------------------------------------------------------------------------
-
- function initialize()
- {
- // PLNOTE: Netscape will not have collasable contents - will probably work in
- // Netscape if you define gBrowser=NN but not worth the bother...
- if (navigator.appName == "Microsoft Internet Explorer")
- gBrowser = IE;
- else if (navigator.appName == "Netscape" && navigator.appVersion.substr(0,1) != "5")
- gBrowser == NN;
-
- // display list.
- displayList(gNodeList, 0, 0);
- // create dummy layer on the bottom so NN will have correct scrolling height.
- if(gBrowser == NN)
- document.write('<layer id="dummy" top=' + gnHiddenTop + ' visibility="hide">\n');
- // select first item on the list.
- if(gNodeList.length > 0)
- parent.nav.updateContents(parent.nav.gCurrPage);
- }
-
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------
-
- function LoadContents()
- {
-
- var nNodeID = 1;
- var tmpList = new Array;
-
- gNodeList[00] = new list('<NOBR><B><font size=2 color="black" face="Helvetica">Getting Started</font></B></NOBR>', 0, 0, 0);
- gNodeList[01] = new list("Introducing Canvas", 1, 8, null, nNodeID++);
- gNodeList[02] = new list("Drawing Basics in Canvas", 9, 18, null, nNodeID++);
- gNodeList[03] = new list("Drawing simple illustrations", 19, 28, null, nNodeID++);
- gNodeList[04] = new list("Introduction to SpriteEffects", 29, 34, null, nNodeID++);
- gNodeList[05] = new list("Introduction to image editing", 35, 46, null, nNodeID++);
- gNodeList[06] = new list("Page Layout & typography", 47, 62, null, nNodeID++);
- gNodeList[07] = new list("Web publishing", 63, 72, null, nNodeID++);
- gNodeList[08] = new list("Introduction", 73, 76, null, nNodeID++);
-
- gNodeList[09] = new list('<NOBR><B><font size=2 color="black" face="Helvetica">Documents & Setup</font></B></NOBR>', 0, 0, 0);
- gNodeList[10] = new list("Running Canvas", 77, 92, null, nNodeID++);
- gNodeList[11] = new list("Document basics", 93, 118, null, nNodeID++);
- gNodeList[12] = new list("Document setup", 119, 130, null, nNodeID++);
- gNodeList[13] = new list("Document layout", 131, 144, null, nNodeID++);
- gNodeList[14] = new list("File and data exchange", 145, 178, null, nNodeID++);
- gNodeList[15] = new list("Web publishing", 179, 220, null, nNodeID++);
- gNodeList[16] = new list("Customizing Canvas", 221, 244, null, nNodeID++);
-
- gNodeList[17] = new list('<NOBR><B><font size=2 color="black" face="Helvetica">Objects & Attributes</font></B></NOBR>', 0, 0, 0);
- gNodeList[18] = new list("Working with objects", 245, 296, null, nNodeID++);
- gNodeList[19] = new list("Macro objects and clip art", 297, 302, null, nNodeID++);
- gNodeList[20] = new list("Inks: colors and patterns", 303, 332, null, nNodeID++);
- gNodeList[21] = new list("Strokes: outline effects", 333, 354, null, nNodeID++);
- gNodeList[22] = new list("SpriteLayer effects", 355, 378, null, nNodeID++);
- gNodeList[23] = new list("Using SpriteEffects", 379, 396, null, nNodeID++);
-
- gNodeList[24] = new list('<NOBR><B><font size=2 color="black" face="Helvetica">Drawing & Vector Effects</font></B></NOBR>', 0, 0, 0);
- gNodeList[25] = new list("Drawing basics", 397, 418, null, nNodeID++);
- gNodeList[26] = new list("Drawing and editing paths", 419, 446, null, nNodeID++);
- gNodeList[27] = new list("Precision drawing and dimensioning", 447, 460, null, nNodeID++);
- gNodeList[28] = new list("Vector effects", 461, 487, null, nNodeID++);
-
- gNodeList[29] = new list('<NOBR><B><font size=2 color="black" face="Helvetica">Text & Typography</font></B></NOBR>', 0, 0, 0);
- gNodeList[30] = new list("Text entry and layout", 489, 512, null, nNodeID++);
- gNodeList[31] = new list("Text editing and proofing", 513, 528, null, nNodeID++);
- gNodeList[32] = new list("Formatting text", 529, 566, null, nNodeID++);
- gNodeList[33] = new list("Using type styles", 567, 572, null, nNodeID++);
- gNodeList[34] = new list("Type effects", 573, 586, null, nNodeID++);
-
- gNodeList[35] = new list('<NOBR><B><font size=2 color="black" face="Helvetica">Painting & Image Editing</font></B></NOBR>', 0, 0, 0);
- gNodeList[36] = new list("Painting and image-editing", 587, 632, null, nNodeID++);
- gNodeList[37] = new list("Scanning, sizing, and tracing images", 633, 650, null, nNodeID++);
- gNodeList[38] = new list("Selections and channels", 651, 682, null, nNodeID++);
- gNodeList[39] = new list("Image adjustment and correction", 683, 706, null, nNodeID++);
- gNodeList[40] = new list("Image filters and effects", 707, 726, null, nNodeID++);
- gNodeList[41] = new list("Image proxies", 727, 734, null, nNodeID++);
-
- gNodeList[42] = new list('<NOBR><B><font size=2 color="black" face="Helvetica">Automation</font></B></NOBR>', 0, 0, 0);
- gNodeList[43] = new list("Sequences", 735, 742, null, nNodeID++);
- gNodeList[44] = new list("Writing Scripts for Canvas", 743, 758, null, nNodeID++);
-
- gNodeList[45] = new list('<NOBR><B><font size=2 color="black" face="Helvetica">----</font></B></NOBR>', 759, 773, null, nNodeID++);
- gNodeList[46] = new list("Glossary", 759, 773, null, nNodeID++);
- }